from sklearn.naive_bayes import GaussianNB
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import pandas as pd

X,y = load_iris(return_X_y=True)
# print(X)
# data = pd.DataFrame(X)
# data.to_csv('1.csv')
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2)
GNB = GaussianNB()
GNB.fit(X_train,y_train)
print(accuracy_score(GNB.predict(X_test), y_test))